#include <stdarg.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "Util.h"

void Util::format(char* buffer, const char* format, ...)
{
    va_list varList;
    va_start(varList, format);
    vsprintf(buffer, format, varList);
    va_end(varList);
}

void Util::getDate(const char* format, char* buffer, unsigned int size)
{
    time_t rawtime;
    struct tm * timeinfo;

    time(&rawtime);
    timeinfo = localtime(&rawtime);

    strftime(buffer, size, format, timeinfo);
}
